import { ajhttp } from '@/utils/http'
import { useTenantSystemStore } from '@/stores'

/**
 * 首页获取预约相关数据
 */
export const mobileClientSummary = (code: string) => {
    return ajhttp({
        method: 'GET',
        url: `/system/report/mobileClientSummary`,
        data: {
            code
        }
    })
}

/**
 * 全局搜索艺人/商家/活动/服务/聚会
 */
export const globalSearch = (data?: any) => {
    const tenantStore = useTenantSystemStore()
    if (!data) {
        data = {
            pid: tenantStore.state.pid
        }
    } else {
        data.pid = tenantStore.state.pid
    }
    return ajhttp({
        method: 'GET',
        url: `/system/report/globalSearch`,
        data
    })
}

/**
 * 获取艺人/商家/活动/服务/聚会词云统计图
 */
export const getWordCloudChart = (data?: any) => {
    const tenantStore = useTenantSystemStore()
    if (!data) {
        data = {
            pid: tenantStore.state.pid
        }
    } else {
        data.pid = tenantStore.state.pid
    }
    return ajhttp({
        method: 'GET',
        url: `/system/report/getWordCloudChart`,
        data
    })
}
